<!DOCTYPE HTML>
<html>
 
<?php 
// include "for_only_train.php";
// include "for_increment.php"; 
// echo $zhishu_name;
?>
<head>
    <meta charset="utf-8">
    <link rel="icon" href="https://jscdn.com.cn/highcharts/images/favicon.ico">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <style>
        /* css 代码  */
    </style>
    <script src="https://code.highcharts.com.cn/jquery/jquery-1.8.3.min.js"></script>
    <script src="https://code.highcharts.com.cn/highstock/highstock.js"></script>
    <script src="https://code.highcharts.com.cn/highcharts/modules/exporting.js"></script>
    <script src="https://code.highcharts.com.cn/highcharts-plugins/highcharts-zh_CN.js"></script>
</head>

<body>
    <div id="container" style="min-width:400px;height:400px"></div>
    <script>
        var dataJSON = JSON.parse(window.localStorage.getItem('jsonDataLine'))
        console.log(dataJSON[0])
        var seriesOptions = [],
            seriesCounter = 0,
            names = [{
                name: '2天',
                data: dataJSON[0]['day:2']
            }, {
                name: '3天',
                data: dataJSON[1]['day:3']
            }, {
                name: '4天',
                data: dataJSON[2]['day:4']
            }, {
                name: '5天',
                data: dataJSON[3]['day:5']
            }, {
                name: '指数',
                data: dataJSON[4]['zhishu']
            }],
            // create the chart when all data is loaded
            createChart = function() {
                Highcharts.stockChart('container', {
                    rangeSelector: {
                        selected: 4
                    },
                    yAxis: {
                        labels: {
                            formatter: function() {
                                return (this.value > 0 ? ' + ' : '') + this.value + '%';
                            }
                        },
                        plotLines: [{
                            value: 0,
                            width: 2,
                            color: 'silver'
                        }]
                    },
                    plotOptions: {
                        series: {
                            compare: 'percent'
                        }
                    },
                    tooltip: {
                        pointFormat: '<span style="color:{series.color}">{series.name}</span>: <b>{point.y}</b> ({point.change}%)<br/>',
                        valueDecimals: 2
                    },
                    series: seriesOptions
                });
            };
        names.forEach((item, index) => {
            seriesOptions[index] = {
                name: item.name,
                data: item.data
            };
            seriesCounter += 1;
            if (seriesCounter === names.length) {
                createChart();
            }
        })
        console.log('111111', dataJSON['day:2'])
    </script>
</body>

</html>

<!-- https://data.jianshukeji.com/jsonp?filename=json/' + name.toLowerCase() + '-c.json&callback=? -->